#include <cstdio>

int main() {
	int T;
	scanf("%d", &T);
	for (int k=1; k<=T; k++) {
		unsigned long long A, B;
		scanf("%llu%llu", &A, &B);
		printf("Case #%d:\n", k);
		if (A==B) {
			printf("1\n");
			printf("%llu %llu\n", A, A);
		} else {
			printf("2\n");
			printf("%llu %llu\n%llu %llu\n", A, B, B, A);
		}
	}
	return 0;
} 
